import 'package:flutter/material.dart';
import 'package:flutter_boost/flutter_boost.dart';
import 'package:xiongmao_clean_flutter_module/business/common/approve/page/approve_entry_depart_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/approve/page/approve_main_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/approve/page/approve_settings_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/insure/page/Insure_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/todo/page/todo_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/page/work_add_post_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/page/work_post_page.dart';
import 'package:xiongmao_clean_flutter_module/business/common/workpost/page/work_rules_page.dart';

import '../../../net/http_config.dart';

/// 定义页面名称
const appRoveMainPage = "appRoveMainPage";

const appEntryDepartMainPage = "appEntryDepartMainPage";

const appSettingsMainPage = "appSettingsMainPage";

/// 第一个界面 审批规则
Map<String, FlutterBoostRouteFactory> appRoveRouterMap = {
  appRoveMainPage: (settings, uniqueId) {
    return MaterialPageRoute(
        settings: settings,
        builder: (_) {
          Map<String, dynamic> map = settings.arguments != null ? settings.arguments as Map<String, dynamic> : {};
          httpConfig.initHttpParams(map);
          return AppRoveMainPage();
        });
  },
};

/// 审批规则的界面
Map<String, FlutterBoostRouteFactory> appEntryDepartRouterMap = {
  appEntryDepartMainPage: (settings, uniqueId) {
    return MaterialPageRoute(
        settings: settings,
        builder: (_) {
          Map<String, dynamic> map = settings.arguments != null ? settings.arguments as Map<String, dynamic> : {};
          httpConfig.initHttpParams(map);
          int index = map["position"];
          return AppEntryDepartMainPage(
            position: index,
          );
        });
  },
};

/// 审批设置
Map<String, FlutterBoostRouteFactory> appSettingsRouterMap = {
  appSettingsMainPage: (settings, uniqueId) {
    return MaterialPageRoute(
        settings: settings,
        builder: (_) {
          Map<String, dynamic> map = settings.arguments != null ? settings.arguments as Map<String, dynamic> : {};
          httpConfig.initHttpParams(map);
          int index = 0;
          return AppSettingsMainPage(
            position: index,
          );
        });
  },
};
